package com.busionline.wotu.baselibrary.mvp.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.busionline.wotu.baselibrary.base.BaseFragment;
import com.busionline.wotu.baselibrary.mvp.IBaseView;
import com.busionline.wotu.baselibrary.mvp.proxy.IPresenterProxy;


/**
 *mvp fragment 基类
 *@author woochen123
 *@time 2018/1/19 15:45
 *@desc
 */

public abstract class BaseMvpFragment extends BaseFragment implements IBaseView {
    IPresenterProxy mPresenterProxy;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mPresenterProxy = new FragmentPresenterProxyImpl<>(this);
        mPresenterProxy.bindPresenter();
        return super.onCreateView(inflater, container, savedInstanceState);
    }


    @Override
    public void onDestroy() {
        mPresenterProxy.unbindPresenter();
        super.onDestroy();
    }
}
